package com.peanut.bosskg.service.other.sign;

import com.alibaba.fastjson.JSON;
import com.peanut.bosskg.entity.ResponseMessageVO;
import com.peanut.bosskg.entity.sign.ApiCancelSignDTO;
import com.peanut.bosskg.entity.sign.ApiCancelSignResultDTO;
import com.peanut.bosskg.enums.FunCodeEnum;
import com.peanut.bosskg.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class CancleSignService extends BaseService {

    public ApiCancelSignResultDTO doBusiness(FunCodeEnum funCodeEnum, ApiCancelSignDTO apiCancelSignDTO) throws Exception {
        log.info("用户解约接口开始:{}，{}", funCodeEnum, apiCancelSignDTO);
        ResponseMessageVO responseMessage = applyYouFuByHttpPost(funCodeEnum, apiCancelSignDTO);
        ApiCancelSignResultDTO resultDTO = JSON.parseObject(responseMessage.getResData(), ApiCancelSignResultDTO.class);
        log.info("用户解约接口结束:{}", resultDTO);
        return resultDTO;
    }
}
